import React, {Component} from 'react'
import { View, Text, SafeAreaView, Button } from 'react-native'

class HomePage extends Component {
    constructor(props){
        super(props)
    }

    render(){
        return (
            <SafeAreaView>
                <Text>Home</Text>
                <Button
                    title="Go DetailPage"
                    onPress={() => {
                        this.props.navigation.navigate("DetailPage", {
                            name: '参数hanhan'
                        })
                    }}
                ></Button>
                {
                    !this.props.navigation.toggleDrawer ? <Text></Text> : 
                    <Button title="打开抽屉" onPress={() => {
                        this.props.navigation.toggleDrawer()
                    }}></Button>
                }
            </SafeAreaView>
        )
    }
}

export default HomePage